package com.gitee.loyo.result;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * T/CEC 102.3-2016
 * 6.3 查询业务策略信息结果
 * 6.3.4 返回值
 */
@Data
public class QueryEquipBusinessPolicyResult implements Serializable {
    /**
     * 业务策略查询流水号
     */
    @JsonProperty("EquipBizSeq")
    private String equipBizSeq;
    /**
     * 充电设备接口编码
     */
    @JsonProperty("ConnectorID")
    private String connectorId;
    @JsonProperty("SuccStat")
    private Integer succStat;
    @JsonProperty("FailReason")
    private Integer failReason;
    /**
     * 时段数N
     */
    @JsonProperty("SumPeriod")
    private Integer sumPeriod;
    @JsonProperty("PolicyInfos")
    private List<PolicyInfo> policyInfos;


    public boolean succeed(){
        return succStat != null && succStat.intValue() == 0;
    }

    /**
     * 单项业务策略信息体
     */
    @Data
    public static class PolicyInfo {
        @JsonProperty("StartTime")
        private String startTime;
        @JsonProperty("ElecPrice")
        private Double elecPrice;
        @JsonProperty("SevicePrice")
        private Double servicePrice;
    }
}
